package com.cqcvc.mapper;

import com.cqcvc.pojo.Docs;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DocsMapper {
    @Delete("delete from docs where id=#{id}")
    public void del(@Param("id") int id);

    @Select("select * from docs where id=#{id}")
    public Docs getById(@Param("id") int id);

    @Select("select * from docs where author=#{author}")
    public List<Docs> search(@Param("author") String author);

    @Insert("insert into docs(title,type,url,author) values(#{title},#{type},#{url},#{author})")
    public int insert(@Param("title") String title, @Param("type") String type, @Param("url") String url, @Param("author") String author);
}
